# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=zim-tools
pkgver=3.1.1
pkgrel=0
pkgdesc="Various ZIM command line tools"
url="https://github.com/openzim/zim-tools"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	cmake
	docopt-dev
	file-dev
	gtest-dev
	gumbo-parser-dev
	libzim-dev
	meson
	mustache
	zlib-dev
	"
replaces="zimwriterfs"
provides="zimwriterfs=$pkgver-r$pkgrel"
subpackages="$pkgname-doc"
source="zim-tools-$pkgver.tar.gz::https://github.com/openzim/zim-tools/archive/$pkgver.tar.gz"

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="
a087da0afb43923e5afb2df21ac13063cb08825adb440cfde0ad1e78ef8cbad341427e61f2392fa7fca8e32b3d7fe68d656b07bdfb4353611e3c53c6a2aaac18  zim-tools-3.1.1.tar.gz
"
